package com.base.library.adapter.item;


import com.base.library.R;

/**
 * coddon error
 */

public class ErrorItem extends BaseItem {

    public String txt = "从服务器获取信息失败";

    public ErrorItem() {
    }

    public ErrorItem(String txt) {
        this.txt = txt;
    }

    @Override
    public int getLayout() {
        return R.layout.multitype_adapter_item_error;
    }

    public ErrorItem setState(int state) {
        this.state = state;
        return this;
    }

    /**
     * ErrorItem has 2 states: Error, Empty
     */
    public final static int ERROR = 0;
    public final static int EMPTY = 1;

    private int state = ERROR;

    public boolean isError() {
        return state == ERROR;
    }

    public boolean isEmpty() {
        return state == EMPTY;
    }
}
